package ch01.BitmapCollision
{
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.filters.GlowFilter;
    import flash.geom.Matrix;
    import flash.geom.Point;
    import flash.text.TextField;
    import flash.utils.getTimer;
    import flash.utils.setTimeout;
    
    import tools.HitTest;
    import tools.Triangle;
    
    /**
     * 不规则物体碰撞测试1,BitmapData.hitTest方法
     * @author sjp
     *
     */
    public class HitTestAll extends Sprite
    {
        private var bmpd1:BitmapData;
        private var bmpd2:BitmapData;
        private var tri1:Triangle;
        private var tri2:Triangle;
        private var isHit:Boolean = false;
        
        public function HitTestAll()
        {
//            stage.align = StageAlign.TOP_LEFT;
//            stage.scaleMode = StageScaleMode.NO_SCALE;
            setTimeout(callLaterHandler, 500);
        }
        
        /**
         * 该函数需要延时处理，否则在IE6下，stage.stageWidth和stage.stageHeight为0，BitmapData创建会出现异常
         * */
        private function callLaterHandler(event:Event = null):void
        {
			var a:HitTest1 = new HitTest1();
			addChild(a);
        }
    
    }
}